home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.6 KB | 130 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FloatFrm.cpp
- // Release Version: $ 1.0d11 $
- //
- // Author: Henri Lamiraux
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "ODFDraw.hpp"
-
- #ifndef FLOATFRM_H
- #include "FloatFrm.h"
- #endif
-
- #ifndef DRAWPART_H
- #include "DrawPart.h"
- #endif
-
- // ----- Part Layer -----
-
- #ifndef FWUTIL_H
- #include "FWUtil.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWRECSHP_H
- #include "FWRecShp.h"
- #endif
-
- #ifndef FWWINDOW_H
- #include "FWWindow.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWDEBUG_H
- #include "FWDebug.h"
- #endif
-
- //========================================================================================
- // Runtime Information
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment odfdrawframes
- #endif
-
- //========================================================================================
- // CLASS CFloatingWindowFrame
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::CFloatingWindowFrame
- //----------------------------------------------------------------------------------------
-
- CFloatingWindowFrame::CFloatingWindowFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CDrawPart *drawPart) :
- FW_CFrame(ev, odFrame, presentation, drawPart),
- fDrawPart(drawPart),
- fFacet(NULL),
- fMapping(FW_kDevice)
- {
- SetCanBeActiveFrame(ev, FALSE);
- }
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::~CFloatingWindowFrame
- //----------------------------------------------------------------------------------------
-
- CFloatingWindowFrame::~CFloatingWindowFrame()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::FacetAdded
- //----------------------------------------------------------------------------------------
-
- void CFloatingWindowFrame::EraseBackground(Environment* ev, FW_CFacetContext& fc)
- {
- FW_CRect rect;
- fc.GetClipRect(rect);
- FW_PInk ink(FW_kRGBLightGray);
- FW_CRectShape::RenderRect(fc, rect, FW_kFill, ink);
- }
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::FacetAdded
- //----------------------------------------------------------------------------------------
-
- void CFloatingWindowFrame::FacetAdded(Environment* ev, ODFacet* facet)
- {
- FW_CFrame::FacetAdded(ev, facet);
-
- FW_ASSERT(fFacet == NULL); // we know we can't have more than one facet
- fFacet = facet;
- }
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::FacetRemoved
- //----------------------------------------------------------------------------------------
-
- void CFloatingWindowFrame::FacetRemoved(Environment* ev, ODFacet* facet)
- {
- FW_ASSERT(facet == fFacet); // we know we can't have more than one facet
- fFacet = NULL;
-
- // ----- Call inherited -----
- FW_CFrame::FacetRemoved(ev, facet);
- }
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::HideShowFloating
- //----------------------------------------------------------------------------------------
-
- void CFloatingWindowFrame::HideShowFloating(Environment* ev)
- {
- FW_CWindow *window = GetWindow(ev);
-
- if (window->IsShown(ev))
- window->Hide(ev);
- else
- window->Show(ev);
- }
-
-
-
-